package MaintMenu.VenPricingUpdMasterFiles;

import javax.swing.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

//import java.sql.SQLException;

public class test {
    public test()
    {
        int x=0;
        int y=0;
        try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String dataSourceName = "dbLI";
            String dbURL = (new StringBuilder()).append("jdbc:odbc:").append(dataSourceName).toString();
            Connection conli = DriverManager.getConnection(dbURL, "", "");
//            String st[] = new String[1];
//            st[0] = ("UPDATE  tblinventory SET prpkey=555 WHERE partslink=NI1248103");
//            st[1] = ("UPDATE tblinventory AS a INNER JOIN tblmrn AS b ON a.[Part#] = b.[Part#] SET a.partslink = b.partlink;");
//
//            st[2] = ("UPDATE tblinventory AS a INNER JOIN tblotn AS b ON a.[Part#] = b.[Part#] SET a.partslink = b.partlink;");
//
//            st[3] = ("UPDATE tblinventory AS a INNER JOIN tblltn AS b ON a.[Part#] = b.[Part#] SET a.partslink = b.partlink;");
//
//            st[4] = ("UPDATE tblinventory AS a INNER JOIN tblcln AS b ON a.[Part#] = b.[Part#] SET a.partslink = b.partlink;");
            Statement stli = conli.createStatement();
            stli.execute("update tblinventory set Make='a', Mdl='b', ModelType='C' where [part#]='ad101';");
//            for (x=1; x<st.length;x++){
//                Statement stli = conli.createStatement();
//                try {
//                    stli.execute(st[x]);
//                }catch(SQLException er) {
//                    er.printStackTrace();
//                }stli.close();
//            }
        }
        catch(Exception e)
        {

            e.printStackTrace();
            JOptionPane.showMessageDialog(null, e);
        }
    }
}
